class Node:
    def __init__(self, item):
        self.item = item
        self.next = None


# 头查法
def linklist(li):
    head = Node(li[0])
    for i in li[1:]:
        node = Node(i)
        node.next = head
        head = node
    return head


def print_linklist(lk):
    while lk:
        print(lk.item, end='-->')
        lk = lk.next


lk = linklist([1,2,3,4,5,6,7])
print_linklist(lk)

